package com.mlf.factory.factory.spring;

import com.mlf.factory.easyFactory.demo.Circle;
import com.mlf.factory.easyFactory.demo.Shape;
import org.springframework.beans.factory.FactoryBean;

// 1. 实现FactoryBean接口
public class CircleFactoryBean implements FactoryBean<Shape> {
   
   @Override
   public Shape getObject() { // 工厂方法实现
       return new Circle(5.0);
   }
   
   @Override
   public Class<?> getObjectType() {
       return Circle.class; // 指定产品类型
   }
   
   @Override
   public boolean isSingleton() {
       return true; // 单例控制
   }
}
